<!--工装管理-->

<!--用户权限说明-->
<!--管理员：代码：1，可以做所有的操作-->
<template>
  <div style="margin: 0;padding: 0">
    <el-container>
      <!--页面表头设计-->
      <el-header style="height: 7vh">
        <el-link class="headMain" href="http://10.255.96.48:3404/">俄动力质量管理系统</el-link>
        <span class="center-text">工装管理</span>
        <el-popover
            placement="top-start"
            title="用户信息"
            width="200"
            trigger="hover">
          <div style="margin-top: 10px">Name：{{useName}}</div>
          <div style="margin-top: 10px">ID:{{useId}}</div>
          <div style="margin-top: 10px" @click="logOut"><el-link>退出</el-link></div>
          <div class="headMain" slot="reference">{{useName}}</div>
        </el-popover>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <div>
            <el-button :style="{marginTop: '10px',width:'180px',backgroundColor:asideButton1 , color:asideButtonColour1}" @click="asideButtonClick(1)">装配车间</el-button>
          </div>
          <div>
            <el-button :style="{marginTop: '10px',width:'180px',backgroundColor:asideButton2 , color:asideButtonColour2}" @click="asideButtonClick(2)">机加车间</el-button>
          </div>
          <div>
            <el-button :style="{marginTop: '10px',width:'180px',backgroundColor:asideButton3 , color:asideButtonColour3}" @click="asideButtonClick(3)">其他部门</el-button>
          </div>
          <hr>
          <div>
            <el-table
                :data="treeTableData"
                style="width: 100%"
                @row-click="treeHandleRowClick"
                :row-style="treeRowStyle"
                size="small">
              <el-table-column
                  prop="position"
                  label="存放位置">
              </el-table-column>
            </el-table>
          </div>
        </el-aside>
        <el-container>
          <!--主题设计-->
          <el-main style="height: 79vh;overflow: auto">
            <el-tabs v-model="activeName" @tab-click="handleClick">
              <el-tab-pane label="工装台账" name="first">
                <div style="text-align: right">
                  <el-link @click="clampListEdit(2,null)" style="color: red;margin-top: -5px">插入一条</el-link>
                </div>
                <div style="margin-top: 5px">
                  <el-table
                      :data="equipmentLedger"
                      border
                      style="width: 100%">
                    <el-table-column
                        prop="clampName"
                        label="工装名称"
                        width="180">
                    </el-table-column>
                    <el-table-column
                        prop="position"
                        label="放置位置"
                        width="180">
                    </el-table-column>
                    <el-table-column
                        prop="department"
                        label="线体/科室"
                        v-slot:default="scope">
                      <span v-if="languageS==='chinese'">{{scope.row.department.split('/')[0]}}</span>
                      <span v-if="languageS==='english'">{{scope.row.department.split('/')[1]}}</span>
                      <span v-if="languageS==='russian'">{{scope.row.department.split('/')[2]}}</span>
                    </el-table-column>
                    <el-table-column
                        prop="modelId"
                        label="应用机型">
                    </el-table-column>
                    <el-table-column
                        prop="number"
                        label="工装编号">
                    </el-table-column>
                    <el-table-column
                        prop="state"
                        label="状态"
                        v-slot:default="scope">
                      <span v-if="languageS==='chinese'">{{scope.row.state.split('/')[0]}}</span>
                      <span v-if="languageS==='english'">{{scope.row.state.split('/')[1]}}</span>
                      <span v-if="languageS==='russian'">{{scope.row.state.split('/')[2]}}</span>
                    </el-table-column>
                    <el-table-column
                        prop="detMark"
                        label="趋势检测标记"
                    v-slot:default="scope">
                      <span v-if="scope.row.detMark!=='' && scope.row.detMark!==undefined && scope.row.detMark!=='undefined'">{{scope.row.detMark}}</span>
                      <span v-else>暂无</span>
                    </el-table-column>
                    <el-table-column
                        label="编辑"
                        v-slot:default="scope">
                      <el-link style="margin-right: 10px" @click="clampListEdit(1,scope)">编辑</el-link>
                      <el-link @click="clampListEdit(3,scope)">删除</el-link>
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
              <el-tab-pane label="工装技术条件" name="second">
                <div style="text-align: right">
                  <el-link @click="technologyEdit(2,null)" style="color: red;margin-top: -5px">插入一条</el-link>
                </div>
                <div style="margin-top: 5px">
                  <el-table
                      :data="equipmentTechnology"
                      border
                      style="width: 100%">
                    <el-table-column type="expand"
                    v-slot:default="scope">
                      <div style="width: 100%; display: flex; align-items: stretch;">
                        <div style="flex: 1; margin: 10px; padding: 5px;">
                          <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                            设备型号：{{scope.row.equipmentType}}
                          </el-card>
                        </div>
                        <div style="flex: 1; margin: 10px; padding: 5px;">
                          <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                            设备类别：
                            <span v-if="languageS==='chinese'">{{scope.row.useType.split('/')[0]}}</span>
                            <span v-if="languageS==='english'">{{scope.row.useType.split('/')[1]}}</span>
                            <span v-if="languageS==='russian'">{{scope.row.useType.split('/')[2]}}</span>
                          </el-card>
                        </div>
                        <div style="flex: 1; margin: 10px; padding: 5px;">
                          <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                            图纸编号：{{scope.row.drawingNo}}
                          </el-card>
                        </div>
                        <div style="flex: 1; margin: 10px; padding: 5px;">
                          <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                            应用机型：{{scope.row.modelId}}
                          </el-card>
                        </div>
                        <div style="flex: 1; margin: 10px; padding: 5px;">
                          <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                            特性分类：{{scope.row.classification}}
                          </el-card>
                        </div>
                      </div>
                    </el-table-column>
                    <el-table-column
                        prop="position"
                        label="工序号">
                    </el-table-column>
                    <el-table-column
                        prop="equipmentName"
                        label="设备名称">
                    </el-table-column>
                    <el-table-column
                        prop="clampName"
                        label="工装名称">
                    </el-table-column>
                    <el-table-column
                        prop="controlProject"
                        label="控制项目"
                        width="250px">
                    </el-table-column>
                    <el-table-column
                        prop="evaluate"
                        label="评价/测量技术">
                    </el-table-column>
                    <el-table-column
                        prop="capacity"
                        label="容量">
                    </el-table-column>
                    <el-table-column
                        prop="frequency"
                        label="频次">
                    </el-table-column>
                    <el-table-column
                        prop="controlMethod"
                        label="控制方法">
                    </el-table-column>
                    <el-table-column
                        prop="department"
                        label="责任部门"
                        v-slot:default="scope">
                      <span v-if="languageS==='chinese' && scope.row.department.split('/').length===3">{{scope.row.department.split('/')[0]}}</span>
                      <span v-if="languageS==='russian' && scope.row.department.split('/').length===3">{{scope.row.department.split('/')[1]}}</span>
                      <span v-if="languageS==='english' && scope.row.department.split('/').length===3">{{scope.row.department.split('/')[2]}}</span>
                    </el-table-column>
                    <el-table-column
                        prop="trendMarkers"
                        label="趋势标记"
                        v-slot:default="scope">
                      <el-link v-if="scope.row.trendMarkers!==''" @click="trendMarkersBookClick(1,scope)">查看/编辑</el-link>
                      <el-link v-if="scope.row.trendMarkers===''" @click="trendMarkersBookClick(2,scope)">暂无/编辑</el-link>
                    </el-table-column>
                    <el-table-column
                        label="编辑"
                        v-slot:default="scope">
                      <el-link style="margin-right: 10px" @click="technologyEdit(1,scope)">编辑</el-link>
                      <el-link @click="technologyEdit(3,scope)">删除</el-link>
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
              <el-tab-pane label="工装检测" name="third">
                <div style="margin-top: 5px">
                  <el-table
                      :data="equTestListData"
                      border
                      style="width: 100%">
                    <el-table-column
                        prop="clampName"
                        label="工装名称"
                        width="180">
                    </el-table-column>
                    <el-table-column
                        prop="position"
                        label="放置位置"
                        width="180">
                    </el-table-column>
                    <el-table-column
                        prop="department"
                        label="线体/科室"
                        v-slot:default="scope">
                      <span v-if="languageS==='chinese'">{{scope.row.department.split('/')[0]}}</span>
                      <span v-if="languageS==='english'">{{scope.row.department.split('/')[1]}}</span>
                      <span v-if="languageS==='russian'">{{scope.row.department.split('/')[2]}}</span>
                    </el-table-column>
                    <el-table-column
                        prop="number"
                        label="工装编号">
                    </el-table-column>
                    <el-table-column
                        label="项目名称"
                        v-slot:default="scope"
                        width="200px">
                      <span v-if="languageS==='chinese'">{{scope.row.project}}</span>
                      <span v-if="languageS==='english'">{{scope.row.projectEnglish}}</span>
                      <span v-if="languageS==='russian'">{{scope.row.projectRussian}}</span>
                    </el-table-column>
                    <el-table-column
                        label="容量"
                        prop="capacity">
                    </el-table-column>
                    <el-table-column
                        label="频次"
                        prop="frequency">
                    </el-table-column>
                    <el-table-column
                        prop="testDate"
                        label="上次检测时间">
                    </el-table-column>
                    <el-table-column
                        label="上传数据"
                        v-slot:default="scope">
                      <el-button @click="equTestClick(1,scope)">上传数据</el-button>
                    </el-table-column>
                  </el-table>
                </div>
              </el-tab-pane>
              <el-tab-pane label="趋势查询" name="fourth">
                <div style="display: flex;margin-left: 10px;margin-right: 10px;height:34vh;overflow: auto">
                  <div style="flex: 1;  border: 1px solid blue; margin-right: 10px">
                  </div>
                  <div style=" border: 1px solid blue; width: 200px; margin-right: 10px">
                    <div>
                      cpk
                    </div>
                  </div>
                  <div style="width: 150px; border: 1px solid blue;">
                    <div style="margin-top: 8px">
                      <el-button style="width: 130px">25组数据</el-button>
                    </div>
                    <div style="margin-top: 8px">
                      <el-button style="width: 130px">50组数据</el-button>
                    </div>
                    <div style="margin-top: 8px">
                      <el-button style="width: 130px">125组数据</el-button>
                    </div>
                    <div style="margin-top: 8px">
                      <el-button style="width: 130px">500组数据</el-button>
                    </div>
                  </div>
                </div>
                <div style="display: flex;margin-left: 10px;margin-right: 10px;margin-top:10px;height:33vh;overflow: auto">
                  <div style="flex: 1;  border: 1px solid blue; margin-right: 10px">
                  </div>
                  <div style="flex: 1;  border: 1px solid blue; margin-right: 10px">
                  </div>
                  <div style="width: 360px; border: 1px solid blue;">
                  </div>
                </div>
              </el-tab-pane>
              <el-tab-pane label="管理中台" name="fifth">管理中台</el-tab-pane>
              <el-tab-pane label="模型说明" name="sixth">模型说明</el-tab-pane>
            </el-tabs>
          </el-main>
          <el-footer>
            <el-button plain size="small" @click="chooseLanguage('chinese')">中  文</el-button>
            <el-button plain size="small" @click="chooseLanguage('russian')">Русский язык</el-button>
            <el-button plain size="small" @click="chooseLanguage('english')">English</el-button>
          </el-footer>
        </el-container>
      </el-container>
    </el-container>

    <!--弹窗放置区-->
    <!--工装清单的弹窗《工装台账》-->
    <el-dialog
        :title="titleUse"
        :visible.sync="clampDialog"
        width="650px"
        :before-close="handleClose">
      <el-form ref="clampDataForm" status-icon :model="clampDataForm"  label-width="120px">
        <el-form-item label="存放位置：">
          <el-select v-model="clampDataForm.position" clearable placeholder="请选择存放位置" style="width: 230px">
            <el-option
                v-for="item in positionOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="clampDataForm.department" clearable placeholder="请选择存放部门" style="margin-left: 10px;width: 230px">
            <el-option
                v-for="item in departmentOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="关联信息：">
          <el-button style="width: 230px" @click="clampAndTec">关联技术条件</el-button>
          <el-button style="width: 230px">
            <span v-if="clampDataForm.clampName!=='' && clampDataForm.clampName!==undefined && clampDataForm.clampName!=='undefined'">关联名称：{{clampDataForm.clampName}}</span>
            <span v-else>未关联</span>
            </el-button>
        </el-form-item>
        <div v-if="clampDataForm.clampName!=='' && clampDataForm.clampName!==undefined && clampDataForm.clampName!=='undefined'">
          <el-form-item label="工装名称：">
            <el-input v-model="clampDataForm.clampName" disabled></el-input>
          </el-form-item>
          <el-form-item label="机型/类别：">
            <el-select v-model="clampDataForm.modelId" clearable placeholder="请选择应用机型" disabled style="width: 150px">
              <el-option
                  v-for="item in modelIdOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
            <el-select v-model="clampDataForm.category" clearable placeholder="请选择类别" style="margin-left: 10px;width: 150px">
              <el-option
                  v-for="item in categoryOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
            <el-select v-model="clampDataForm.state" clearable placeholder="请选择状态" style="margin-left: 10px;width: 150px">
              <el-option
                  v-for="item in stateOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="工装编号：">
            <el-input v-model="clampDataForm.number"></el-input>
          </el-form-item>
          <el-form-item label="出厂编号：">
            <el-input v-model="clampDataForm.exNumber"></el-input>
          </el-form-item>
          <el-form-item label="使用记录：">
            <el-date-picker
                v-model="clampDataForm.startDate"
                type="date"
                placeholder="选择日期"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd"
                style="width: 240px">
            </el-date-picker>
            <el-input v-model="clampDataForm.startEngineId" style="width: 240px;margin-left: 10px" placeholder="请输入起始发动机号"></el-input>
          </el-form-item>
          <el-form-item label="停用记录：">
            <el-date-picker
                v-model="clampDataForm.endData"
                type="date"
                placeholder="选择日期"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd"
                style="width: 150px">
            </el-date-picker>
            <el-input v-model="clampDataForm.endEngineId" style="width: 200px;margin-left: 10px" placeholder="请输入停用发动机号"></el-input>
            <el-input v-model="clampDataForm.useNumber" style="width: 120px;margin-left: 10px" placeholder="使用台数"></el-input>
          </el-form-item>
        </div>
        <el-form-item label="提交结果：">
          <el-button type="primary" @click="clampDataFormClick">确定</el-button>
          <el-button @click="clampDialog=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!--工装技术条件的弹窗《工装技术条件》-->
    <el-dialog
        :title="titleUse"
        :visible.sync="technologyDialog"
        width="650px"
        :before-close="handleClose">
      <el-form ref="equipmentTechnologyForm" status-icon :model="equipmentTechnologyForm"  label-width="120px">
        <el-form-item label="工序类别：">
          <el-select v-model="equipmentTechnologyForm.workshop" clearable placeholder="请选择车间名称" style="width: 155px;margin-right: 10px">
            <el-option
                v-for="item in workShopOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="equipmentTechnologyForm.position" clearable placeholder="请选择工序名称" style="width: 155px;margin-right: 10px">
          <el-option
              v-for="item in positionOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
          <el-select v-model="equipmentTechnologyForm.modelId" clearable placeholder="请选择应用机型" style="width: 155px">
            <el-option
                v-for="item in modelIdOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="设备信息：">
          <el-input v-model="equipmentTechnologyForm.equipmentName" placeholder="请输入设备名称" style="margin-bottom: 5px"></el-input>
          <el-input v-model="equipmentTechnologyForm.equipmentType" placeholder="请输入设备编号" style="width: 300px;margin-right: 10px"></el-input>
          <el-select v-model="equipmentTechnologyForm.useType" clearable placeholder="请选择类别" style="width: 180px">
            <el-option
                v-for="item in useTypeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="工装信息：">
          <el-input v-model="equipmentTechnologyForm.clampName" placeholder="请输入工装名称" style="margin-bottom: 5px"></el-input>
          <el-input v-model="equipmentTechnologyForm.drawingNo" placeholder="请输入图纸编号" style="width: 300px;margin-right: 10px"></el-input>
          <el-select v-model="equipmentTechnologyForm.source" clearable placeholder="请选择来源" style="width: 180px">
            <el-option
                v-for="item in sourceOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="控制要求：">
          <el-input v-model="equipmentTechnologyForm.controlProject" placeholder="请输入控制项目" style="margin-bottom: 5px"></el-input>
          <el-select v-model="equipmentTechnologyForm.evaluate" clearable placeholder="请选择评价/测量技术" style="width: 155px;margin-right: 10px">
            <el-option
                v-for="item in evaluateOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="equipmentTechnologyForm.capacity" clearable placeholder="请选择容量" style="width: 155px;margin-right: 10px">
            <el-option
                v-for="item in capacityOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="equipmentTechnologyForm.frequency" clearable placeholder="请选择频次" style="width: 155px">
            <el-option
                v-for="item in frequencyOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <div style="margin-top: 5px">
            <el-select v-model="equipmentTechnologyForm.classification" clearable placeholder="请选择特殊特性分类" style="width: 155px;margin-right: 10px">
              <el-option
                  v-for="item in classificationOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
            <el-select v-model="equipmentTechnologyForm.controlMethod" clearable placeholder="请选择控制方法" style="width: 155px;margin-right: 10px">
              <el-option
                  v-for="item in controlMethodOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
            <el-select v-model="equipmentTechnologyForm.department" clearable placeholder="请选择责任部门" style="width: 155px;">
              <el-option
                  v-for="item in departmentOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
              </el-option>
            </el-select>
          </div>
        </el-form-item>
        <el-form-item label="其他信息">
          <el-button style="width: 155px">关联作业指导书</el-button>
          <el-button style="width: 155px">关联台账</el-button>
        </el-form-item>
        <el-form-item label="提交结果：">
          <el-button type="primary" @click="technologyRowClick">确定</el-button>
          <el-button @click="technologyDialog=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!--工装技术条件的《检测项目弹窗》-->
    <el-dialog
        :title="titleUse"
        :visible.sync="trendMarkersDialog"
        width="750px"
        :before-close="handleClose">
      <div>
        <el-link v-if="trendMarkersBook.length===0" @click="trendMarkersBookEditClick(4,null)">新建</el-link>
      </div>
      <el-table
          :data="trendMarkersBook"
          style="width: 100%"
          stripe
          border>
        <el-table-column type="expand">
          <template v-slot:default="props">
            <el-form label-position="left" inline class="demo-table-expand">
              <el-form-item label="注意点">
                <span v-if="languageS==='chinese'">{{ props.row.noHot.split('|*|')[0] }}</span>
                <span v-if="languageS==='english'">{{ props.row.noHot.split('|*|')[1] }}</span>
                <span v-if="languageS==='russian'">{{ props.row.noHot.split('|*|')[2] }}</span>
              </el-form-item>
            </el-form>
          </template>
        </el-table-column>
        <el-table-column
            label="检测项目"
            prop="project"
            width="180px"
            v-slot:default="props">
          <span v-if="languageS==='chinese'">{{ props.row.project.split('|*|')[0] }}</span>
          <span v-if="languageS==='english'">{{ props.row.project.split('|*|')[1] }}</span>
          <span v-if="languageS==='russian'">{{ props.row.project.split('|*|')[2] }}</span>
        </el-table-column>
        <el-table-column
            label="检测类型"
            prop="standardType"
            width="150px">
        </el-table-column>
        <el-table-column
            label="标准值"
            prop="standard"
            width="80px">
        </el-table-column>
        <el-table-column
            label="上公差"
            prop="limit"
            width="80px">
        </el-table-column>
        <el-table-column
            label="下公差"
            prop="lower"
            width="80px">
        </el-table-column>
        <el-table-column
            label="编辑"
            v-slot:default="scope"
            width="100px">
          <el-link @click="trendMarkersBookEditClick(1,scope)" style="margin-right: 10px"><i class="el-icon-edit"></i></el-link>
          <el-link @click="trendMarkersBookEditClick(2,scope)" style="margin-right: 10px"><i class="el-icon-download"></i></el-link>
          <el-link @click="trendMarkersBookEditClick(3,scope)" style="margin-right: 10px"><i class="el-icon-delete"></i></el-link>
        </el-table-column>
      </el-table>
    </el-dialog>
    <!--《检测项目弹窗》中的弹窗，是编辑检测项目的-->
    <el-dialog
        :title="titleUse"
        :visible.sync="trendMarkersEditDialog"
        width="650px"
        :before-close="handleClose">
      <el-form ref="trendMarkersEditForm" status-icon :model="trendMarkersEditForm"  label-width="120px">
        <el-form-item label="检测项目：">
          <el-input v-model="trendMarkersEditForm.project" placeholder="请输入检查项目中文内容" style="margin-bottom: 5px"></el-input>
          <el-input v-model="trendMarkersEditForm.projectEnglish" placeholder="请输入检查项目英文内容" style="margin-bottom: 5px"></el-input>
          <el-input v-model="trendMarkersEditForm.projectRussian" placeholder="请输入检查项目俄文内容" style="margin-bottom: 5px"></el-input>
        </el-form-item>
        <el-form-item label="要点说明：">
          <el-input v-model="trendMarkersEditForm.noHot" placeholder="请输入要点说明中文内容" style="margin-bottom: 5px"></el-input>
          <el-input v-model="trendMarkersEditForm.noHotEnglish" placeholder="请输入要点说明英文内容" style="margin-bottom: 5px"></el-input>
          <el-input v-model="trendMarkersEditForm.noHotRussian" placeholder="请输入要点说明英文内容"></el-input>
        </el-form-item>
        <el-form-item label="检测类型：">
          <el-select v-model="trendMarkersEditForm.projectType" clearable placeholder="请选择项目类型" style="width: 230px;margin-right: 30px">
            <el-option
                v-for="item in projectTypeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
          <el-select v-model="trendMarkersEditForm.standardType" clearable placeholder="请选择公差类型" style="width: 230px">
            <el-option
                v-for="item in standardTypeOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="检测标准：">
          <el-input v-model="trendMarkersEditForm.standard" placeholder="请输入标准值" style="width: 155px;margin-right: 10px"></el-input>
          <el-input v-model="trendMarkersEditForm.limit" placeholder="请输入上公差" style="width: 155px;margin-right: 10px"></el-input>
          <el-input v-model="trendMarkersEditForm.lower" placeholder="请输入下公差" style="width: 155px;"></el-input>
        </el-form-item>
        <el-form-item label="提交结果：">
          <el-button type="primary" @click="trendMarkersEditRowClick">确定</el-button>
          <el-button @click="trendMarkersEditDialog=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!--关联工装技术条件的弹窗-->
    <el-dialog
        :title="titleUse"
        :visible.sync="addTecDialog"
        width="750px"
        :before-close="handleClose">
      <el-table
          :data="addTecData"
          border
          style="width: 100%"
          highlight-current-row
          @row-click="addTeaTableClick">
        <el-table-column type="expand"
                         v-slot:default="scope">
          <div style="width: 100%; display: flex; align-items: stretch;">
            <div style="flex: 1; margin: 10px; padding: 5px;">
              <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                设备型号：{{scope.row.equipmentType}}
              </el-card>
            </div>
            <div style="flex: 1; margin: 10px; padding: 5px;">
              <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                设备类别：
                <span v-if="languageS==='chinese'">{{scope.row.useType.split('/')[0]}}</span>
                <span v-if="languageS==='english'">{{scope.row.useType.split('/')[1]}}</span>
                <span v-if="languageS==='russian'">{{scope.row.useType.split('/')[2]}}</span>
              </el-card>
            </div>
            <div style="flex: 1; margin: 10px; padding: 5px;">
              <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                图纸编号：{{scope.row.drawingNo}}
              </el-card>
            </div>
            <div style="flex: 1; margin: 10px; padding: 5px;">
              <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                应用机型：{{scope.row.modelId}}
              </el-card>
            </div>
            <div style="flex: 1; margin: 10px; padding: 5px;">
              <el-card class="box-card" style="display: flex; align-items: center; height: 100%;">
                特性分类：{{scope.row.classification}}
              </el-card>
            </div>
          </div>
        </el-table-column>
        <el-table-column
            prop="position"
            label="工序号">
        </el-table-column>
        <el-table-column
            prop="equipmentName"
            label="设备名称">
        </el-table-column>
        <el-table-column
            prop="clampName"
            label="工装名称">
        </el-table-column>
        <el-table-column
            prop="controlProject"
            label="控制项目"
            width="250px">
        </el-table-column>
        <el-table-column
            prop="evaluate"
            label="评价/测量技术">
        </el-table-column>
        <el-table-column
            prop="capacity"
            label="容量">
        </el-table-column>
        <el-table-column
            prop="frequency"
            label="频次">
        </el-table-column>
        <el-table-column
            prop="controlMethod"
            label="控制方法">
        </el-table-column>
      </el-table>
    </el-dialog>
    <!--《工装检测数据上传》中的弹窗，是新增检测数据-->
    <el-dialog
        :title="titleUse"
        :visible.sync="equTestDialog"
        width="400px"
        :before-close="handleClose">
      <el-form ref="trendMarkersEditForm" status-icon :model="equTestListFrom"  label-width="120px">
        <el-form-item label="检测项目：">
          <span v-if="languageS==='chinese'">{{equTestListFrom.project}}</span>
          <span v-if="languageS==='english'">{{equTestListFrom.projectEnglish}}</span>
          <span v-if="languageS==='russian'">{{equTestListFrom.projectRussian}}</span>
        </el-form-item>
        <el-form-item label="检测值：">
          <el-input v-model="equTestListFrom.valueUse" placeholder="请输入要实测值" style="width: 100%"></el-input>
        </el-form-item>
        <el-form-item label="检测时间：">
          <el-date-picker
              v-model="equTestListFrom.testDate"
              type="date"
              placeholder="选择日期"
              format="yyyy 年 MM 月 dd 日"
              value-format="yyyy-MM-dd"
              style="width: 100%">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="检测人：">
          <el-input v-model="equTestListFrom.testPer" placeholder="请输入标准值" style="width: 100%"></el-input>
        </el-form-item>
        <el-form-item label="提交结果：">
          <el-button type="primary" @click="equTestEditClick">确定</el-button>
          <el-button @click="equTestDialog=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <!--抽屉放置区域-->
  </div>
</template>
<script>
import {departmentOptions, opList} from "@/configUse";
import _, {toInteger} from "lodash";

export default {
  name: "equipmentManagement",
  components: {},
  data() {
    return {
      activeName:'first',
      //用户权限相关的变量
      useName:'',//用户名称
      useId:'',//用户编号
      usePower:'',//用户权限

      //记录语言的变量
      languageS:'chinese',

      //控制导航栏中的
      asideButton1:'#0269fa',
      asideButton2:'',
      asideButton3:'',
      asideButtonColour1:'white',
      asideButtonColour2:'',
      asideButtonColour3:'',
      //工装、工具清单台账
      equipmentLedger:[{
        //主键
        id:0,
        //工装名称
        clampName:'',
        //放置位置
        position:'',
        //线体/科室
        department:'',
        //应用机型
        modelId:'',
        //单位
        company:'',
        //工装编号
        number:'',
        //出厂编号
        exNumber:'',
        //类别
        category:'',
        //状态
        state:'',
        //作业指导数关联
        workBookId:'',
        //控制计划关联
        controlPlan:'',
        //趋势检测标记位
        detMark:'',
        //使用开始日期
        startDate:'',
        //停用日期
        endData:'',
        //使用发动机号
        startEngineId:'',
        //停用发动机号
        endEngineId:'',
        //停用类型
        endType:'',
        //使用台数
        useNumber:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
        //编辑人姓名
        editName:'',
      }],
      //工装、工具清单的表单编辑控件用到的《工装台账》
      clampDataForm:{//主键
        id:0,
        //工装名称
        clampName:'',
        //放置位置
        position:'',
        //线体/科室
        department:'',
        //应用机型
        modelId:'',
        //单位
        company:'',
        //工装编号
        number:'',
        //出厂编号
        exNumber:'',
        //类别
        category:'',
        //状态
        state:'',
        //作业指导数关联
        workBookId:'',
        //控制计划管理
        controlPlan:'',
        //使用日期
        startDate:'',
        //停用日期
        endData:'',
        //使用发动机号
        startEngineId:'',
        //停用发动机号
        endEngineId:'',
        //停用类型
        endType:'',
        //使用台数
        useNumber:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
        //编辑人姓名
        editName:'',
      },
      //《工装技术条件》大表
      equipmentTechnology:[{
        //主键
        id:0,
        //工序号
        position:'',
        //设备名称
        equipmentName:'',
        //设备型号
        equipmentType:'',
        //类别
        useType:'',
        //工装名称
        clampName:'',
        //工装图纸编号
        drawingNo:'',
        //应用机型
        modelId:'',
        //控制项目
        controlProject:'',
        //特殊特性分类
        classification:'',
        //评价/测量技术
        evaluate:'',
        // 容量
        capacity:'',
        //频次
        frequency:'',
        //控制方法
        controlMethod:'',
        //责任部门
        department:'',
        //作业指导数关联
        workBookId:'',
        //台账关联
        LedgerSign:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
        //编辑人姓名
        editName:'',
        // 趋势标记
        trendMarkers:'',
        //来源
        source:'',
        //所属车间
        workshop:'',
      }],
      //《工装技术条件》台账修改的表单用变量
      equipmentTechnologyForm:{
      //主键
          id:0,
          //工序号
          position:'',
          //设备名称
          equipmentName:'',
          //设备型号
          equipmentType:'',
          //类别
          useType:'',
          //工装名称
          clampName:'',
          //工装图纸编号
          drawingNo:'',
          //应用机型
          modelId:'',
          //控制项目
          controlProject:'',
          //特殊特性分类
          classification:'',
          //评价/测量技术
          evaluate:'',
          // 容量
          capacity:'',
          //频次
          frequency:'',
          //控制方法
          controlMethod:'',
          //责任部门
          department:'',
          //作业指导数关联
          workBookId:'',
          //台账关联
          LedgerSign:'',
          //删除标记位
          deleteSign:'',
          //创建时间
          establishTime:'',
          //修改时间
          updateTime:'',
          //编辑人姓名
          editName:'',
          // 趋势标记
          trendMarkers:'',
        //来源
        source:'',
        //所属车间
        workshop:'',
    },
      //导航用到的列表
      treeTableData:[
        {position:10},
        {position:20}
      ],
      //记录工装技术条件中的检测项目
      trendMarkersBook:[
        {
          //id
          id:0,
          //检测项目
          project:'',
          //标准值
          standard:0,
          //上公差
          limit:0,
          //下公差
          lower:0,
          //公差类型
          standardType:'',
          //注意点
          noHot:'',
          //项目类型
          projectType:'',
          //预留2
          reserve1:'预留',
          //预留3
          reserve2:'预留',
          //预留4
          reserve3:'预留',
        }
      ],
      //记录工装技术条件中的检测项目，中的表单修改变量
      trendMarkersEditForm:{
        //id
        id:0,
        //检测项目
        project:'',
        projectEnglish:'',
        projectRussian:'',
        //标准值
        standard:'',
        //上公差
        limit:'',
        //下公差
        lower:'',
        //公差类型
        standardType:'',
        //注意点
        noHot:'',
        noHotEnglish:'',
        noHotRussian:'',
        //项目类型
        projectType:'',
        //预留2
        reserve1:'预留',
        //预留3
        reserve2:'预留',
        //预留4
        reserve3:'预留',
      },
      //用户点击的变量记录
      //记录用户是在哪个标签上,是导航部分的按钮，记录的是车间顺序：1.装配车间；2.机加车间
      asideButtonDoe:1,//默认是装配车间

      //记录用户点击的是对工装台账的那种操作：1.编辑；2.添加；3.删除；
      clampListEditDoe:'',
      //记录用户点击的工装台账的Scope格式
      equipmentLedgerScope:'',
      //记录用户点击对工装技术条件的那种操作：1.编辑；2.添加；3.删除；
      equipmentTechnologyDoe:'',
      //记录用户点击的技术条件的Scope格式

      //记录用户点击了工装技术条件中的《检测项目》中的某一行，要进行编辑了:1.编辑；2.删除；3.向下增加；
      trendMarkersBookEditDoe:'',
      ////记录用户点击了工装技术条件中的《检测项目》中的某一行，的Scope格式。
      trendMarkersBookEditScope:'',
      equipmentTechnologyScope:'',
      //记录用户在树形栏上点击了哪一行
      treeCurrentRow:null,

      //关联《工装技术条件》的大表变量弹窗
      addTecData:[{
        //主键
        id:0,
        //工序号
        position:'',
        //设备名称
        equipmentName:'',
        //设备型号
        equipmentType:'',
        //类别
        useType:'',
        //工装名称
        clampName:'',
        //工装图纸编号
        drawingNo:'',
        //应用机型
        modelId:'',
        //控制项目
        controlProject:'',
        //特殊特性分类
        classification:'',
        //评价/测量技术
        evaluate:'',
        // 容量
        capacity:'',
        //频次
        frequency:'',
        //控制方法
        controlMethod:'',
        //责任部门
        department:'',
        //作业指导数关联
        workBookId:'',
        //台账关联
        LedgerSign:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
        //编辑人姓名
        editName:'',
        // 趋势标记
        trendMarkers:'',
        //来源
        source:'',
        //所属车间
        workshop:'',
      }],//筛选后的数据
      addTecDataAll:[{
        //主键
        id:0,
        //工序号
        position:'',
        //设备名称
        equipmentName:'',
        //设备型号
        equipmentType:'',
        //类别
        useType:'',
        //工装名称
        clampName:'',
        //工装图纸编号
        drawingNo:'',
        //应用机型
        modelId:'',
        //控制项目
        controlProject:'',
        //特殊特性分类
        classification:'',
        //评价/测量技术
        evaluate:'',
        // 容量
        capacity:'',
        //频次
        frequency:'',
        //控制方法
        controlMethod:'',
        //责任部门
        department:'',
        //作业指导数关联
        workBookId:'',
        //台账关联
        LedgerSign:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
        //编辑人姓名
        editName:'',
        // 趋势标记
        trendMarkers:'',
        //来源
        source:'',
        //所属车间
        workshop:'',
      }],//没有筛选的数据，作为关联控制计划项

      //工装台账检测数据的大表
      equTestListData:[
        {
          //主键
          id:'',
          //工装名称
          clampName:'',
          //放置位置
          position:'',
          //线体/科室
          department:'',
          //应用机型
          modelId:'',
          //单位
          company:'',
          //工装编号
          number:'',
          //工装台账关联项
          equLedList:'',
          //项目名称（中文）
          project:'',
          //项目名称（中文）
          projectEnglish:'',
          //项目名称（俄文）
          projectRussian:'',
          //标准值
          standard:'',
          //上公差
          limit:'',
          //下公差
          lower:'',
          //公差类型
          standardType:'',
          //实测值
          valueUse:'',
          //检测人
          testPer:'',
          //检测时间
          testDate:'',
          //检测周期(容量）
          capacity:'',
          //检测周期（频次）
          frequency:'',
          //修改信息
          editMess:'',
          //删除标记位
          deleteSign:'',
          //创建时间
          establishTime:'',
          //修改时间
          updateTime:'',
        }
      ],
      //工装台账检测数据的弹窗编辑
      equTestListFrom:{
        //主键
        id:'',
        //工装名称
        clampName:'',
        //放置位置
        position:'',
        //线体/科室
        department:'',
        //应用机型
        modelId:'',
        //单位
        company:'',
        //工装编号
        number:'',
        //工装台账关联项
        equLedList:'',
        //项目名称（中文）
        project:'',
        //项目名称（中文）
        projectEnglish:'',
        //项目名称（俄文）
        projectRussian:'',
        //标准值
        standard:'',
        //上公差
        limit:'',
        //下公差
        lower:'',
        //公差类型
        standardType:'',
        //实测值
        valueUse:'',
        //检测人
        testPer:'',
        //检测时间
        testDate:'',
        //检测周期(容量）
        capacity:'',
        //检测周期（频次）
        frequency:'',
        //修改信息
        editMess:'',
        //删除标记位
        deleteSign:'',
        //创建时间
        establishTime:'',
        //修改时间
        updateTime:'',
      },
      //工装台账检测数据的点击Scope格式
      equTestListScope:null,
      //工装台账检测数据的点击类型：1:新上传；2.编辑；3.删除
      equTestListDoe:'',


      //弹窗用到的变量
      titleUse:'提示',
      //控制《工装台账》的编辑弹窗
      clampDialog:false,
      //控制《工装技术条件》的编辑弹窗
      technologyDialog:false,
      //点击趋势标记弹窗
      trendMarkersDialog:false,
      //控制编辑工装技术条件中的检测项目编辑
      trendMarkersEditDialog:false,
      //控制关联《工装技术条件》的弹窗
      addTecDialog:false,
      //控制工装检测数据上传的弹窗
      equTestDialog:false,


      //工装放置位置的弹窗选择
      positionOptions:opList,
      /*各类选择的变量*/
      //选择部门
      departmentOptions:departmentOptions,
      // 选择适用机型
      modelIdOptions:[
        {value:'EB/EN',label:'EB/EN'},
        {value:'EB全系',label:'EB全系'},
        {value:'EN全系',label:'EN全系'},
        {value:'EB05',label:'EB05'},
        {value:'EB35',label:'EB35'},
        {value:'EB75',label:'EB75'},
        {value:'EN19',label:'EN19'},
        {value:'EN38',label:'EN38'},
      ],
      // 选择类别
      categoryOptions:[
        {value:'A',label:'A'},
        {value:'B',label:'B'},
        {value:'C',label:'C'},
        {value:'D',label:'D'},
      ],
      //使用状态
      stateOptions:[
        {value:'正在使用/In use/В эксплуатации',label:'正在使用/In use/В эксплуатации'},
        {value:'损坏停用/Damaged and out of service/Повреждение и отключено',label:'损坏停用/Damaged and out of service/Повреждение и отключено'},
        {value:'强制更换/involuntary conversion/Обязательная замена',label:'强制更换/involuntary conversion/Обязательная замена'},
        {value:'到寿命更换/End of life replacement/Замена до срока службы',label:'到寿命更换/End of life replacement/Замена до срока службы'},
      ],
      //车间名称
      workShopOptions:[
        {
          value: '装配车间/Assembly workshop/сборочный цех',
          label: '装配车间/Assembly workshop/сборочный цех'
        },
        {
          value: '机加车间/Machining workshop/Машиностроительный цех',
          label: '机加车间/Machining workshop/Машиностроительный цех'
        },
      ],
      //记录工装技术条件中的类别
      useTypeOptions:[
        {value:'其他/other/Прочее',label:'其他/other/Прочее'},
        {value:'打刻针/Engraving needle/Гравировальная игла',label:'打刻针/Engraving needle/Гравировальная игла'},
        {value:'定位支撑/Positioning support block/Опорный блок позиционирования',label:'定位支撑/Positioning support block/Опорный блок позиционирования'},
        {value:'夹紧工装/Clamping tool/Зажимной инструмент',label:'夹紧工装/Clamping tool/Зажимной инструмент'},
        {value:'套筒/sleeve/торцевая головка',label:'套筒/sleeve/торцевая головка'},
        {value:'涨开工装/Tools used to prop up objects/Инструменты, используемые для поддержки объектов',label:'涨开工装/Tools used to prop up objects/Инструменты, используемые для поддержки объектов'},
        {value:'止动限位/stop limit/стоп-лимит',label:'止动限位/stop limit/стоп-лимит'},
        {value:'拧紧轴/Tighten the shaft/Затяните вал',label:'拧紧轴/Tighten the shaft/Затяните вал'},
        {value:'压装工装/Press-fit tooling/Инструмент для запрессовки',label:'压装工装/Press-fit tooling/Инструмент для запрессовки'},
        {value:'导向工装/Guide tooling/Направляющий инструмент',label:'导向工装/Guide tooling/Направляющий инструмент'},
        {value:'喷嘴/nozzle/сопло',label:'喷嘴/nozzle/сопло'},
        {value:'捅入工装/Import tool/Инструмент импорта',label:'捅入工装/Import tool/Инструмент импорта'},
        {value:'调整工装/Tools for adjustment/Инструменты для настройки',label:'调整工装/Tools for adjustment/Инструменты для настройки'},
        {value:'工艺套/Process bushing/Технологическая втулка',label:'工艺套/Process bushing/Технологическая втулка'},
        {value:'工艺螺栓/Process bolts/Технологические болты',label:'工艺螺栓/Process bolts/Технологические болты'},
        {value:'检测工装/Inspection tooling/Инструменты для проверки',label:'检测工装/Inspection tooling/Инструменты для проверки'},
        {value:'预带工装/Pre-belt tooling/Инструмент для предварительной обработки',label:'预带工装/Pre-belt tooling/Инструмент для предварительной обработки'},
        {value:'涂胶头/Glue nozzle/Насадка для клея',label:'涂胶头/Glue nozzle/Насадка для клея'},
        {value:'封堵/sealing tool/уплотнительный инструмент',label:'封堵/sealing tool/уплотнительный инструмент'},
        {value:'防尖工装/Tools to prevent sharp objects/Инструменты для предотвращения попадания острых предметов',label:'防尖工装/Tools to prevent sharp objects/Инструменты для предотвращения попадания острых предметов'},
        {value:'拍打头',label:'拍打头'},
        {value:'工具/tools/инструменты',label:'工具'},
        {value:'物流工装/Logistics tooling/Логистический инструментарий',label:'物流工装/Logistics tooling/Логистический инструментарий'},
      ],
      //记录工装技术条件中的来源
      sourceOptions:[
        {value:'工程下发',label:'工程下发'},
        {value:'自行识别',label:'自行识别'},
      ],
      //记录工装技术条件中的评价/测量技术
      evaluateOptions:[
        {value:'目视',label:'目视/visual/Зрительный'},
        {value:'手触',label:'手触/Hand touch/Руки коснулись'},
        {value:'目视/手触',label:'目视、手触/visual、Hand touch/Зрительный、Hand touch'},
        {value:'卡尺',label:'卡尺/calipers/штангенциркуль'},
        {value:'扳手',label:'扳手/wrench/Ключ'},
        {value:'千分尺',label:'千分尺/micrometer/Микрометр'},
        {value:'塞尺',label:'塞尺/Feeler/Фейлер'},
        {value:'验棒/标准样件',label:'验棒、标准样件/Test rod、Standard sample/Тестовый стержень, стандартный образец'},
        {value:'角度校准仪',label:'角度校准仪/Angle calibrator/калибратор угла'},
        {value:'目视/工具检查',label:'目视+工具检查/visual+Tool inspection/Визуальный + инструментальный контроль'},
        {value:'目视/排胶',label:'目视、排胶/visual、Glue dispensing/Зрение, клей.'},
        {value:'人工记录或计数器',label:'人工记录、计数器/Manual recording/Ручная запись'},
        {value:'验棒/检测工装',label:'验棒、检测工装/Test rod、Detecting device/Испытательный стержень, контрольное устройство'},
        {value:'深度尺/卡尺',label:'深度尺、卡尺/Depth Gauge、calipers/Глубиномер, штангенциркуль'},
        {value:'千分尺/卡尺',label:'千分尺、卡尺/micrometer、calipers/Микрометр、штангенциркуль'},
        {value:'目视/手动检查',label:'目视、手动检查/visual、Manual inspection/Зрительный、Проверка вручную'},
        {value:'排湿除锈润滑剂',label:'排湿除锈润滑剂/'},
        {value:'工件验证',label:'工件验证/Workpiece verification/Проверка работы'},
        {value:'扭矩校准仪',label:'扭矩校准仪/Torque calibrator/калибратор крутящего момента'},
      ],
      //记录工装技术条件中的容量
      capacityOptions:[
        {value:'1次',label:'1次'},
        {value:'2次',label:'2次'},
        {value:'3次',label:'3次'},
        {value:'100%',label:'100%'},
        {value:'50%',label:'50%'},
        {value:'10%',label:'10%'},
      ],
      //记录工装技术条件中的频次
      frequencyOptions:[
        {
          value: '每天班前',
          label: '每天班前'
        },
        {
          value: '每周',
          label: '每周'
        },
        {
          value: '每两周',
          label: '每两周'
        },
        {
          value: '每月',
          label: '每月'
        },
        {
          value: '每两月',
          label: '每两月'
        },
        {
          value: '每季度',
          label: '每季度'
        },
        {
          value: '每半年',
          label: '每半年'
        },
        {
          value: '每年',
          label: '每年'
        },
        {
          value: '每2天',
          label: '每2天'
        },
        {
          value: '连续',
          label: '连续'
        },
        {
          value: '入厂检测',
          label: '入厂检测'
        },
        {
          value: '更换时',
          label: '更换时'
        },
      ],
      //记录工装技术条件中的特殊特性分类
      classificationOptions:[
        {value:'安全',label:'安全'},
        {value:'重要',label:'重要'},
      ],
      //记录工装技术条件中的控制方法
      controlMethodOptions:[
        {value:'自检',label:'自检'},
        {value:'点检表',label:'点检表'},
        {value:'易损工装/工具更换记录',label:'易损工装/工具更换记录'},
        {value:'工装零件尺寸检测记录单',label:'工装零件尺寸检测记录单'},
        {value:'工装维护保养计划/记录',label:'工装维护保养计划/记录'},
        {value:'计量器具检定/记录',label:'计量器具检定/记录'},
        {value:'EAM策略库',label:'EAM策略库'},
      ],
      //记录工装技术条件中的检测项目类型：计量型、计数型、目视检测
      projectTypeOptions:[
        {value:'计量型',label:'计量型'},
        {value:'计数型',label:'计数型'},
        {value:'目视',label:'目视'},
      ],
      //记录是单边公差还是双边公差
      standardTypeOptions:[
        {value:'单边公差',label:'单边公差'},
        {value:'双边公差',label:'双边公差'},
      ]
    }
  },
  watch: {},
  methods: {
    //语言选择的函数变化
    chooseLanguage(doe){
      this.languageS=doe
    },
    //退出登录
    logOut(){
      localStorage.removeItem('u_token');
      localStorage.removeItem('userName')
      this.$router.push('UserLogin')
    },
    //查询用户信息的函数
    inquiry(){
      //输入用户编号，向后端查询信息
      const useId=localStorage.getItem('userName').replace(/"/g, '');
      this.$request.post('/useQueryPower',{
        queryFiledName:'changeModel',
        userId:useId,
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          this.useName=result.data.name
          this.usePower=result.data.changeModel
          this.useId=useId
        }
      })
    },
    //在tab控件上单击的函数
    handleClick(tab) {
      this.treeTableData=[]
      if (tab.name==='first'){
        this.treePosition('department','position',this.asideButtonDoe)
        this.equipmentLedger=[]
      }
      else if (tab.name==='second'){
        this.treeTechnologyPosition('department','position',this.asideButtonDoe)
        this.equipmentTechnology=[]
      }
      else if (tab.name==='third'){
        this.treePosition('department','position',this.asideButtonDoe)
        //数据清空
        this.equTestListData=[]
      }
    },
    //在导航栏上单击那个车间的工装
    asideButtonClick(doe){
      //把用户点击的那个车间信息传递出去
      this.asideButtonDoe=doe
      if (doe===1){
        this.asideButton1='#0269fa'
        this.asideButton2=''
        this.asideButton3=''
        this.asideButtonColour1='white'
        this.asideButtonColour2=''
        this.asideButtonColour3=''
        //清空树形导航数据，并重新查询,首先要确认是那个标签上的，区分出来要查那些数据
        this.treeTableData=[]
        //是要看《工装台账》
        if (this.activeName==='first'){
          this.treePosition('department','position',1)
        }
        //是哟啊看《工装技术条件》
        else if (this.activeName==='second'){
          this.treeTechnologyPosition('department','position',1)
        }
      }
      else if (doe===2){
        this.asideButton1=''
        this.asideButton2='#0269fa'
        this.asideButton3=''
        this.asideButtonColour1=''
        this.asideButtonColour2='white'
        this.asideButtonColour3=''
        //清空树形导航数据，并重新查询,首先要确认是那个标签上的，区分出来要查那些数据
        this.treeTableData=[]
        //是看《工装台账》
        if (this.activeName==='first'){
          this.treePosition('department','position',2)
        }
        //是看《工装技术条件》
        else if (this.activeName==='second'){
          this.treeTechnologyPosition('department','position',2)
        }
      }
      else if (doe===3){
        this.asideButton1=''
        this.asideButton2=''
        this.asideButton3='#0269fa'
        this.asideButtonColour1=''
        this.asideButtonColour2=''
        this.asideButtonColour3='white'
        //清空树形导航数据，并重新查询,首先要确认是那个标签上的，区分出来要查那些数据
        this.treeTableData=[]
        if (this.activeName==='first'){
          this.treePosition('department','position',3)
        }
        else if (this.activeName==='second'){
          this.treeTechnologyPosition('department','position',3)
        }
      }
    },
    // 通用，弹窗关闭的时候
    handleClose(done) {
      this.$confirm('确认关闭？')
          // eslint-disable-next-line no-unused-vars
          .then(_ => {
            done();
          })
          // eslint-disable-next-line no-unused-vars
          .catch(_ => {});
    },
    //单击工装清单列表进行编辑
    clampListEdit(doe,scope){
      this.clampListEditDoe=doe
      this.equipmentLedgerScope=scope
      //限定选定菜单
      if (this.asideButtonDoe===1){
        console.log("dao ")
        this.departmentOptions=[
          {
            value: '装配车间/Assembly workshop/сборочный цех',
            label: '装配车间/Assembly workshop/сборочный цех'
          },
        ]
      }
      //是编辑操作
      if (doe===1){
        this.titleUse='您正在修改本行数据'
        this.clampDataForm=_.cloneDeep(scope.row)
        if (this.clampDataForm.useNumber===0){
          this.clampDataForm.useNumber=''
        }
        this.clampDialog=true
      }
      else if (doe===2){
        this.titleUse='您正在插入一行数据'
        this.clampDataForm={//主键
          id:-1,
          //工装名称
          clampName:'',
          //放置位置
          position:'',
          //线体/科室
          department:'',
          //应用机型
          modelId:'',
          //单位
          company:'俄罗斯动力/Russian Engine',
          //工装编号
          number:'',
          //出厂编号
          exNumber:'',
          //类别
          category:'',
          //状态
          state:'',
          //作业指导数关联
          workBookId:'',
          //控制计划管理
          controlPlan:'',
          //使用日期
          startDate:'',
          //停用日期
          endData:'',
          //使用发动机号
          startEngineId:'',
          //停用发动机号
          endEngineId:'',
          //停用类型
          endType:'',
          //使用台数
          useNumber:'',
          //删除标记位
          deleteSign:1,
          //创建时间
          establishTime:'',
          //修改时间
          updateTime:'',
          //修改人
          editName: this.useName,
        }
        this.clampDialog=true
      }
      else if (doe===3){
        this.titleUse='您正在删除本行数据'
        this.clampDataForm=_.cloneDeep(scope.row)
        this.clampDialog=true
      }
      console.log(this.clampDataForm.clampName)
    },
    //点击编辑、增加工装台账的弹窗，点击确定
    clampDataFormClick(){
      //是编辑工装台账
      if (this.clampListEditDoe===1){
        //数据校核
        if (this.clampDataForm.clampName===''){
          alert("工装名称为空，请输入")
        }
        else if (this.clampDataForm.position===''){
          alert("工装放置位置为空，请选择")
        }
        else if (this.clampDataForm.department===''){
          alert("所属部门为空，请选择")
        }
        else if (this.clampDataForm.modelId===''){
          alert("应用机型为空，请选择")
        }
        else if (this.clampDataForm.number===''){
          alert("工装编号为空，请输入")
        }
        else if (this.clampDataForm.exNumber===''){
          alert("出厂编号为空，请输入")
        }
        else if (this.clampDataForm.category===''){
          alert("类别为空，请输入")
        }
        else if (this.clampDataForm.state===''){
          alert("状态为空，请输入")
        }
        else if (this.clampDataForm.useNumber!=='' && !/^\+?[1-9]\d*$/.test(this.clampDataForm.useNumber)){
          alert("输入的使用数量非数字，请核对")
        }
        else {
          // 组合修改人信息
          this.clampDataForm.editName=this.clampDataForm.editName+'/'+this.useName
          //向后端进行数据传递，修改本行数据
          this.$request.post('/equipmentManagementInsertEdit',this.clampDataForm).then(result=>{
            if (result.code === 401) {
              this.$router.push('UserLogin')
              alert("您未登录，请登录")
            }else {
              //给表中赋值
              this.equipmentLedger.splice(this.equipmentLedgerScope.$index, 1, result.data)
              this.equipmentLedgerScope.row=result.data
              this.clampDialog=false
              alert("保存成功")
            }
          })
        }
      }
      //是插入工装台账
      else if (this.clampListEditDoe===2){
        //数据校核
        if (this.clampDataForm.clampName===''){
          alert("工装名称为空，请输入")
        }
        else if (this.clampDataForm.position===''){
          alert("工装放置位置为空，请选择")
        }
        else if (this.clampDataForm.department===''){
          alert("所属部门为空，请选择")
        }
        else if (this.clampDataForm.modelId===''){
          alert("应用机型为空，请选择")
        }
        else if (this.clampDataForm.number===''){
          alert("工装编号为空，请输入")
        }
        else if (this.clampDataForm.exNumber===''){
          alert("出厂编号为空，请输入")
        }
        else if (this.clampDataForm.category===''){
          alert("类别为空，请输入")
        }
        else if (this.clampDataForm.state===''){
          alert("状态为空，请输入")
        }
        else if (this.clampDataForm.useNumber!=='' && !/^\+?[1-9]\d*$/.test(this.clampDataForm.useNumber)){
          alert("输入的使用数量非数字，请核对")
        }
        else {

          //向后端发起请求，
          this.$request.post('/equipmentManagementInsert',this.clampDataForm).then(async result => {
            if (result.code === 401) {
              this.$router.push('UserLogin')
              alert("您未登录，请登录")
            } else {
              alert(result.data)
              //重新筛选数据，显示工装台账
              if (this.clampDataForm.department === '机加车间/Machining workshop/Машиностроительный цех') {
                this.asideButtonDoe = 0;
                //筛选大表的数据
                this.equipmentLedger = await this.selectClampData(this.clampDataForm.department, this.clampDataForm.position, 2)
                //给重新筛选出的数据，标记现在跳转的位置
                this.asideButtonClick(2);
                this.treePosition('department', 'position', this.asideButtonDoe)
                //给下面的行赋值,改选择的颜色,自己就触发了，不需要写代码

              } else if (this.clampDataForm.department === '装配车间/Assembly workshop/сборочный цех') {
                this.equipmentLedger=await this.selectClampData(this.clampDataForm.department, this.clampDataForm.position, 1)
                //给重新筛选出的数据，标记现在跳转的位置
                this.asideButtonClick(1);
                this.treePosition('department', 'position', this.asideButtonDoe)

              } else {
                this.equipmentLedger=await this.selectClampData(this.clampDataForm.department, this.clampDataForm.position, 3)
                //给重新筛选出的数据，标记现在跳转的位置
                this.asideButtonClick(3);
                this.treePosition('department', 'position', this.asideButtonDoe)
              }
              this.treeCurrentRow = ''
              this.treeCurrentRow = _.cloneDeep(this.clampDataForm)
              //关闭窗口
              this.clampDialog = false
            }
          })
        }
      }
      //是删除一行
      else if (this.clampListEditDoe===3){
        //消除用户误操作，让数据变化
        this.clampDataForm=_.cloneDeep(this.equipmentLedgerScope.row)
        //设置删除标记位
        this.clampDataForm.deleteSign=0
        //向后端发起请求，
        this.$request.post('/equipmentManagementInsertEdit',this.clampDataForm).then(result=>{
          if (result.code === 401) {
            this.$router.push('UserLogin')
            alert("您未登录，请登录")
          }else {
            alert("删除成功")
            //重新筛选数据，显示工装台账
            //给表中赋值
            this.equipmentLedger.splice(this.equipmentLedgerScope.$index, 1)
            this.equipmentLedgerScope.row=null
            //关闭窗口
            this.clampDialog=false
          }
        })
      }
    },
    //单击工装技术条件列表进行编辑的弹窗
    technologyEdit(doe,scope){
      this.equipmentTechnologyDoe=doe
      this.equipmentTechnologyScope=scope
      if (doe===1){
        this.titleUse='您正在编辑一行工装技术条件'
        this.equipmentTechnologyForm=_.cloneDeep(scope.row)
        this.technologyDialog=true
      }
      else if (doe===2){
        this.titleUse='您正在插入一行工装技术条件'
        this.equipmentTechnologyForm={
          //主键
          id:-1,
          //工序号
          position:'',
          //设备名称
          equipmentName:'',
          //设备型号
          equipmentType:'',
          //类别
          useType:'',
          //工装名称
          clampName:'',
          //工装图纸编号
          drawingNo:'',
          //应用机型
          modelId:'',
          //控制项目
          controlProject:'',
          //特殊特性分类
          classification:'',
          //评价/测量技术
          evaluate:'',
          // 容量
          capacity:'',
          //频次
          frequency:'',
          //控制方法
          controlMethod:'',
          //责任部门
          department:'',
          //作业指导数关联
          workBookId:'',
          //台账关联
          LedgerSign:'',
          //删除标记位
          deleteSign:1,
          //创建时间
          establishTime:'',
          //修改时间
          updateTime:'',
          //编辑人姓名
          editName:'',
          // 趋势标记
          trendMarkers:'',
          //来源
          source:'',
          //所属车间
          workshop:'',
        }
        this.technologyDialog=true
      }
      else if (doe===3){
        this.titleUse='您正在删除一行工装技术条件'
        this.equipmentTechnologyForm=_.cloneDeep(scope.row)
        this.technologyDialog=true
      }
    },
    //单击工装技术条件列表的弹窗的确定按钮
    technologyRowClick(){
      if (this.equipmentTechnologyDoe===1){
        //是编辑操作
        //进行校验数据
        //进行数据校验
        if (this.equipmentTechnologyForm.op===''){
          alert("工序未选择，请选择工序号")
        }
        else if (this.equipmentTechnologyForm.workshop===''){
          alert("所属车间未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.modelId===''){
          alert("应用机型未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.equipmentName===''){
          alert("设备名称未填写，请选择")
        }
        else if (this.equipmentTechnologyForm.equipmentType===''){
          alert("设备型号未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.useType===''){
          alert("类别未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.clampName===''){
          alert("工装名称未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.drawingNo===''){
          alert("工装图号未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.source===''){
          alert("来源未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.controlProject===''){
          alert("控制项目未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.evaluate===''){
          alert("评价/测量技术未现在，请选择")
        }
        else if (this.equipmentTechnologyForm.capacity===''){
          alert("容量未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.frequency===''){
          alert("频次未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.classification===''){
          alert("特殊特性未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.controlMethod===''){
          alert("控制方法未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.department===''){
          alert("责任部门未选择，请选择")
        }
        else {
        //组合编辑人信息
        this.equipmentTechnologyForm.editName=this.equipmentTechnologyScope.row.editName+'/'+this.useName
        //向后端发送请求
          this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnologyForm).then(result=>{
            if (result.code === 401) {
              this.$router.push('UserLogin')
              alert("您未登录，请登录")
            }else {
              this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1, result.data)
              alert("修改成功")
              this.technologyDialog=false
            }
          })
        }
      }
      //是插入操作
      else if (this.equipmentTechnologyDoe===2){
        //进行数据校验
        if (this.equipmentTechnologyForm.op===''){
          alert("工序未选择，请选择工序号")
        }
        else if (this.equipmentTechnologyForm.workshop===''){
          alert("所属车间未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.modelId===''){
          alert("应用机型未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.equipmentName===''){
          alert("设备名称未填写，请选择")
        }
        else if (this.equipmentTechnologyForm.equipmentType===''){
          alert("设备型号未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.useType===''){
          alert("类别未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.clampName===''){
          alert("工装名称未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.drawingNo===''){
          alert("工装图号未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.source===''){
          alert("来源未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.controlProject===''){
          alert("控制项目未填写，请填写")
        }
        else if (this.equipmentTechnologyForm.evaluate===''){
          alert("评价/测量技术未现在，请选择")
        }
        else if (this.equipmentTechnologyForm.capacity===''){
          alert("容量未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.frequency===''){
          alert("频次未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.classification===''){
          alert("特殊特性未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.controlMethod===''){
          alert("控制方法未选择，请选择")
        }
        else if (this.equipmentTechnologyForm.department===''){
          alert("责任部门未选择，请选择")
        }
        else {
          //组合编辑人信息
          this.equipmentTechnologyForm.editName=this.useName
          //向后端发送请求，插入数据
          this.$request.post('/equipmentTechnologyInsert',this.equipmentTechnologyForm).then(result=>{
            if (result.code === 401) {
              this.$router.push('UserLogin')
              alert("您未登录，请登录")
            }else {
              alert(result.data)
              //给树形结构赋值值
              this.treeTechnologyPosition('department','position',this.asideButtonDoe)
            }
          })
        }
      }
      //是删除操作
      else if (this.equipmentTechnologyDoe===3){
        //把信息拷贝回来，防止误操作
        this.equipmentTechnologyForm=_.cloneDeep(this.equipmentTechnologyScope.row)
        //编辑人组合,和删除标记位
        this.equipmentTechnologyForm.deleteSign=0
        this.equipmentTechnologyForm.editName=this.equipmentTechnologyForm.editName+'/'+this.useName
        //向后端发送请求
        this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnologyForm).then(result=>{
          if (result.code === 401) {
            this.$router.push('UserLogin')
            alert("您未登录，请登录")
          }else {
            this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1)
            alert("删除成功")
            this.trendMarkersEditDialog=false
          }
        })
      }
    },
    //点击树形列表上的行,高亮显示，并筛选数据
    // eslint-disable-next-line no-unused-vars
    async treeHandleRowClick(row, column, event) {
      this.treeCurrentRow = row; // 当行被点击时，设置currentRow为当前行
      //进行数据筛选操作
      //确认是《工装台账的筛选》
      if (this.activeName === 'first') {
        if (this.asideButtonDoe === 1) {
          this.equipmentLedger=await this.selectClampData("装配车间/Assembly workshop/сборочный цех", row.position, 1)
        } else if (this.asideButtonDoe === 2) {
          this.equipmentLedger=await this.selectClampData('机加车间/Machining workshop/Машиностроительный цех', row.position, 2)
        } else if (this.asideButtonDoe === 3) {
          this.equipmentLedger=await this.selectClampData('', row.position, 3)
        }
      }
      else if (this.activeName === 'second') {
        if (this.asideButtonDoe === 1) {
          this.equipmentTechnology =await this.selectTechnologyData("装配车间/Assembly workshop/сборочный цех", row.position, 1)
        } else if (this.asideButtonDoe === 2) {
          this.equipmentTechnology=await this.selectTechnologyData('机加车间/Machining workshop/Машиностроительный цех', row.position, 2)
        } else if (this.asideButtonDoe === 3) {
          this.equipmentTechnology=await this.selectTechnologyData('', row.position, 3)
        }
      }
      else if (this.activeName === 'third'){
        this.equTestListData=[]
        let equipmentLedger
        //把工装台账中的数据都筛选出来，现在给了工装台账的大表，其实这里应该用带有返回值的函数就更好了
        if (this.asideButtonDoe === 1) {
          equipmentLedger=await this.selectClampData("装配车间/Assembly workshop/сборочный цех", row.position, 1)
        } else if (this.asideButtonDoe === 2) {
          equipmentLedger=await this.selectClampData('机加车间/Machining workshop/Машиностроительный цех', row.position, 2)
        } else if (this.asideButtonDoe === 3) {
          equipmentLedger=await this.selectClampData('', row.position, 3)
        }
        let equipmentTechnology
        //把工装技术条件中的数据都筛选出来，现在给了工装技术条件的大表，其实这里应该用带有返回值的函数就更好了
        if (this.asideButtonDoe === 1) {
          equipmentTechnology =await this.selectTechnologyData("装配车间/Assembly workshop/сборочный цех", row.position, 1)
        } else if (this.asideButtonDoe === 2) {
          equipmentTechnology=await this.selectTechnologyData('机加车间/Machining workshop/Машиностроительный цех', row.position, 2)
        } else if (this.asideButtonDoe === 3) {
          equipmentTechnology=await this.selectTechnologyData('', row.position, 3)
        }

        //循环准备数据,对工装台账中是否有需要检测的进行识别
        this.equTestListData=[]
        for (let i = 0; i < equipmentLedger.length; i++) {
          //对他的控制计划内容进行分割
          let cTemp=equipmentLedger[i].controlPlan.split('/')
          for (let j = 1; j < cTemp.length; j++) {
            // 找出这个控制计划ID下的工装技术条件
            let tecItem=equipmentTechnology.filter(item => item.id === toInteger(cTemp[j]))
            //如果这一条的检测项目数据有内容，就需要对数据进行组合了
            if (tecItem[0].trendMarkers!=='' && tecItem[0].trendMarkers!==undefined && tecItem[0].trendMarkers!=='undefined'){
              console.log("这里应该出现1次",tecItem)
              //把检测项目切割出来，涉及到了第三层的循环
                let trendTemp=tecItem[0].trendMarkers.split('|-|')
              for (let k = 0; k < trendTemp.length-1; k++) {
                //分解出检测项目的元素
                const bookTemp= trendTemp[k].split('|%|')
                const temp={
                  //id
                  id:i,
                  //检测项目
                  project:bookTemp[0],
                  //标准值
                  standard:bookTemp[1],
                  //上公差
                  limit:bookTemp[2],
                  //下公差
                  lower:bookTemp[3],
                  //公差类型
                  standardType:bookTemp[4],
                  //注意点
                  noHot:bookTemp[6],
                  //项目类型
                  projectType:bookTemp[5],
                  //预留2
                  reserve1:bookTemp[7],
                  //预留3
                  reserve2:bookTemp[8],
                  //预留4
                  reserve3:bookTemp[9],
                }
                //筛选出上一次检测的时间
                //组合检测展现的数据
                let test={
                  //主键
                  id:'',
                  //工装名称
                  clampName:equipmentLedger[i].clampName,
                  //放置位置
                  position:equipmentLedger[i].position,
                  //线体/科室
                  department:equipmentLedger[i].department,
                  //应用机型
                  modelId:equipmentLedger[i].modelId,
                  //单位
                  company:equipmentLedger[i].company,
                  //工装编号
                  number:equipmentLedger[i].number,
                  //工装台账关联项
                  equLedList:cTemp[j],
                  //项目名称（中文）
                  project:temp.project.split('|*|')[0],
                  //项目名称（中文）
                  projectEnglish:temp.project.split('|*|')[1],
                  //项目名称（俄文）
                  projectRussian:temp.project.split('|*|')[2],
                  //标准值
                  standard:temp.standard,
                  //上公差
                  limit:temp.limit,
                  //下公差
                  lower:temp.lower,
                  //公差类型
                  standardType:temp.standardType,
                  //实测值
                  valueUse:'',
                  //检测人
                  testPer:'',
                  //检测时间
                  testDate:'',
                  //检测周期(容量）
                  capacity:tecItem[0].capacity,
                  //检测周期（频次）
                  frequency:tecItem[0].frequency,
                  //修改信息
                  editMess:'',
                  //删除标记位
                  deleteSign:1,
                  //创建时间
                  establishTime:'',
                  //修改时间
                  updateTime:'',
                }
                this.$request.post('equLastTimeTest',test).then(result=>{
                  if (result.code === 401) {
                    this.$router.push('UserLogin')
                    alert("您未登录，请登录")
                  }else {
                    test.testDate=result.data.testDate
                    this.equTestListData.push(test)
                  }
                })
              }
            }
          }
        }

      }
    },
    //辅助函数：修改表中的样式，增加底色
    // eslint-disable-next-line no-unused-vars
    treeRowStyle({row, rowIndex}) {
      // 如果当前行是currentRow，则返回特定的样式
      if (this.treeCurrentRow && this.treeCurrentRow.position === row.position) {
        return {
          backgroundColor: '#007bff', // 蓝色背景
          color: '#ffffff' // 白色文字
        };
      }
      return {}; // 否则不应用任何样式
    },
    //辅助函数：做导航栏中的存放数据的筛选,筛选的数据库是：《工装台账清单》
    treePosition(fistField,secondField,type){
      //向后端发送请求，请求树形列表
      this.$request.post('equipmentManagementTreePosition',{
        fistField:fistField,
        secondField:secondField,
        type:type
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          this.treeTableData=result.data
        }
      })
    },
    //辅助函数：做导航栏中的存放数据的筛选,筛选的数据库是：《工装技术条件》
    treeTechnologyPosition(fistField,secondField,type){
      //向后端发送请求，请求树形列表
      this.$request.post('equipmentTechnologyTreePosition',{
        fistField:fistField,
        secondField:secondField,
        type:type
      }).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          this.treeTableData=result.data
        }
      })
    },
    //辅助函数：根据车间/存放位置，筛选出《工装台账》
    async selectClampData(filedVal1, filedVal2, type) {
      try {
        // 向后端发起请求，进行数据查询
        const result = await this.$request.post('/equipmentManagementSelectClampData', {
          filedVal1: filedVal1,
          filedVal2: filedVal2,
          type: type
        });

        if (result.code === 401) {
          // 如果未登录，则重定向到登录页面并显示警告
          this.$router.push('UserLogin');
          alert("您未登录，请登录");
          // 在这种情况下，我们可以抛出一个错误或返回一个特定的值来表示失败
          throw new Error("未登录");
        } else {
          // 如果请求成功，则返回数据
          return result.data;
        }
      } catch (error) {
        // 处理请求中的任何错误（包括网络错误和抛出的错误）
        console.error("请求数据时发生错误:", error);
        // 可以选择返回一个默认值或null，或者再次抛出错误让调用者处理
        return null; // 或者 throw error;
      }
    },
    //辅助函数：根据车间/存放位置，筛选出《工装技术条件》
    async selectTechnologyData(filedVal1, filedVal2, type) {
      try {
        const result = await this.$request.post('/equipmentManagementSelectTechnologyData', {
          filedVal1: filedVal1,
          filedVal2: filedVal2,
          type: type
        });

        if (result.code === 401) {
          await this.$router.push('UserLogin');
          alert("您未登录，请登录");
          // 在这里，您可能想要抛出一个错误，以便调用者可以捕获并处理它。
          // 如果您不抛出错误，那么调用者将不会知道登录失败的情况。
          throw new Error("未登录");
        }

        // 直接返回 result.data，而不是将其赋值给一个局部变量再返回。
        return result.data;
      } catch (error) {
        console.error("请求数据时发生错误:", error);
        // 您可以根据需要处理错误，比如返回一个默认值、null 或重新抛出错误。
        // 在这里，我们选择重新抛出错误，以便调用者可以捕获并处理它。
        throw error;
      }
    },
    //辅助函数：获取当前时间，并格式化为YYYY-MM-DD时间格式
    nowDate(){
      const date = new Date();
      // 获取年份（yyyy）
      const year = date.getFullYear();

      // 获取日期（dd），并填充前导零
      const day = String(date.getDate()).padStart(2, '0');

      // 获取月份（MM），并填充前导零
      const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始，所以需要+1

      // 格式化日期为 yyyy-dd-MM
      return `${year}-${month}-${day}`;
    },
    //在检测项目上单击,进行的弹窗，展现现在的检测项目列表
    trendMarkersBookClick(doe,scope){
      this.equipmentTechnologyScope=scope
      this.trendMarkersDialog=true

      //更新检测项目的表格
      this.trendMarkersBook=[]
      //把项目切割出来
      const book=scope.row.trendMarkers.split('|-|')
      for (let i = 0; i < book.length-1; i++) {
        //对每一个项目进行赋值
        const bookTemp=book[i].split('|%|')
        const temp={
          //id
          id:i,
          //检测项目
          project:bookTemp[0],
          //标准值
          standard:bookTemp[1],
          //上公差
          limit:bookTemp[2],
          //下公差
          lower:bookTemp[3],
          //公差类型
          standardType:bookTemp[4],
          //注意点
          noHot:bookTemp[6],
          //项目类型
          projectType:bookTemp[5],
          //预留2
          reserve1:bookTemp[7],
          //预留3
          reserve2:bookTemp[8],
          //预留4
          reserve3:bookTemp[9],
        }
        this.trendMarkersBook.push(temp)
      }
    },
    //在检测项目上单击，进行编辑检测项目，有：编辑，删除，向下增加,新建；
    trendMarkersBookEditClick(doe,scope){
      this.trendMarkersBookEditDoe=doe
      this.trendMarkersBookEditScope=scope
      //是编辑
      if (doe===1){
        this.trendMarkersEditForm=_.cloneDeep(scope.row)
        //分割语言
        this.trendMarkersEditForm.project=scope.row.project.split('|*|')[0]
        this.trendMarkersEditForm.projectEnglish=scope.row.project.split('|*|')[1]
        this.trendMarkersEditForm.projectRussian=scope.row.project.split('|*|')[2]
        this.trendMarkersEditForm.noHot=scope.row.noHot.split('|*|')[0]
        this.trendMarkersEditForm.noHotEnglish=scope.row.noHot.split('|*|')[1]
        this.trendMarkersEditForm.noHotRussian=scope.row.noHot.split('|*|')[2]
        this.trendMarkersEditDialog=true
      }
      //是向下插入
      else if (doe===2){
        //清空数据
        this.trendMarkersEditForm={
          //id
          id:0,
          //检测项目
          project:'',
          projectEnglish:'',
          projectRussian:'',
          //标准值
          standard:'',
          //上公差
          limit:'',
          //下公差
          lower:'',
          //公差类型
          standardType:'',
          //注意点
          noHot:'',
          noHotEnglish:'',
          noHotRussian:'',
          //项目类型
          projectType:'',
          //预留2
          reserve1:'预留',
          //预留3
          reserve2:'预留',
          //预留4
          reserve3:'预留',
        }
        this.trendMarkersEditDialog=true
      }
      //是删除
      if (doe===3){
        this.trendMarkersEditForm=_.cloneDeep(scope.row)
        //分割语言
        this.trendMarkersEditForm.project=scope.row.project.split('|*|')[0]
        this.trendMarkersEditForm.projectEnglish=scope.row.project.split('|*|')[1]
        this.trendMarkersEditForm.projectRussian=scope.row.project.split('|*|')[2]
        this.trendMarkersEditForm.noHot=scope.row.noHot.split('|*|')[0]
        this.trendMarkersEditForm.noHotEnglish=scope.row.noHot.split('|*|')[1]
        this.trendMarkersEditForm.noHotRussian=scope.row.noHot.split('|*|')[2]
        this.trendMarkersEditDialog=true
      }
      //是新建一个
      else if (doe===4){
        //清空数据
        this.trendMarkersEditForm={
          //id
          id:0,
              //检测项目
              project:'',
              projectEnglish:'',
              projectRussian:'',
              //标准值
              standard:'',
              //上公差
              limit:'',
              //下公差
              lower:'',
              //公差类型
              standardType:'',
              //注意点
              noHot:'',
              noHotEnglish:'',
              noHotRussian:'',
              //项目类型
              projectType:'',
              //预留2
              reserve1:'预留',
              //预留3
              reserve2:'预留',
              //预留4
              reserve3:'预留',
        }
        this.trendMarkersEditDialog=true
      }
    },
    //在检测项目的编辑弹窗，需要进行后端保存了。就是涉及到对大表中的本行修改
    trendMarkersEditRowClick(){
      //是修改
      if (this.trendMarkersBookEditDoe===1){
        //校验数据
        if (this.trendMarkersEditForm.project===''){
          alert("请输入检测项目中文名称")
        }
        else if (this.trendMarkersEditForm.projectEnglish===''){
          alert("请输入检测项目英文名称")
        }
        else if (this.trendMarkersEditForm.projectRussian===''){
          alert("请输入检测项目俄文名称")
        }
        else if (this.trendMarkersEditForm.noHot===''){
          alert("请输入中文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotEnglish===''){
          alert("请输入英文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotRussian===''){
          alert("请输入俄文检测要点")
        }
        else if (this.trendMarkersEditForm.standardType===''){
          alert("请选择测量类型")
        }
        else if (this.trendMarkersEditForm.projectType===''){
          alert("请选择项目类型")
        }
        else if (this.trendMarkersEditForm.standard===''){
          alert("请写入标准值")
        }
        else if (this.trendMarkersEditForm.limit===''){
          alert("请输入上公差")
        }
        else if (this.trendMarkersEditForm.lower===''){
          alert("请输入下公差")
        }
        else {
          //校验是否有效数字
          let num = Number(this.trendMarkersEditForm.standard)
          //判断是不是一个有效的数据
          if (!(!isNaN(num) && isFinite(num))){
            alert("标准值输入的数字无效，请重新输入")
          }
          else {
            //校验是否有效数字
            let num1 = Number(this.trendMarkersEditForm.limit)
            //判断是不是一个有效的数据
            if (!(!isNaN(num1) && isFinite(num1))){
              alert("上公差输入的数字无效，请重新输入")
            }
            else {
              //校验是否有效数字
              let num2 = Number(this.trendMarkersEditForm.lower)
              //判断是不是一个有效的数据
              if (!(!isNaN(num2) && isFinite(num2))){
                alert("下公差输入的数字无效，请重新输入")
              }
              else {
                //组合数据
                let item=this.trendMarkersEditForm.project + '|*|' +
                    this.trendMarkersEditForm.projectEnglish + '|*|' +
                    this.trendMarkersEditForm.projectRussian + '|%|' +
                    this.trendMarkersEditForm.standard + '|%|' +
                    this.trendMarkersEditForm.limit + '|%|' +
                    this.trendMarkersEditForm.lower + '|%|' +
                    this.trendMarkersEditForm.standardType + '|%|' +
                    this.trendMarkersEditForm.projectType + '|%|' +
                    this.trendMarkersEditForm.noHot + '|*|' +
                    this.trendMarkersEditForm.noHotEnglish + '|*|' +
                    this.trendMarkersEditForm.noHotRussian + '|%|' +
                    this.trendMarkersEditForm.reserve1+'|%|'+
                    this.trendMarkersEditForm.reserve2+'|%|'+
                    this.trendMarkersEditForm.reserve3+'|%|'
                //把元数据分割
                let temp=this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers.split('|-|')
                //分割后的数据替换
                temp[this.trendMarkersBookEditScope.$index]=item
                //重新组合成为数据库中的文本
                let book=''
                for (let i = 0; i < temp.length-1; i++) {
                  book=book+temp[i]+'|-|'
                }
                //把组合的数据赋值给大表
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers=book
                //组合编辑人信息
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName=this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName+'/'+this.useName
                //向后端发送请求
                this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnology[this.equipmentTechnologyScope.$index]).then(result=>{
                  if (result.code === 401) {
                    this.$router.push('UserLogin')
                    alert("您未登录，请登录")
                  }else {
                    //更新大表数据
                    this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1, result.data)
                    //更新检测项目的表格
                    this.trendMarkersBook=[]
                    //把项目切割出来
                    const book=result.data.trendMarkers.split('|-|')
                    for (let i = 0; i < book.length-1; i++) {
                      //对每一个项目进行赋值
                      const bookTemp=book[i].split('|%|')
                      const temp={
                        //id
                        id:i,
                        //检测项目
                        project:bookTemp[0],
                        //标准值
                        standard:bookTemp[1],
                        //上公差
                        limit:bookTemp[2],
                        //下公差
                        lower:bookTemp[3],
                        //公差类型
                        standardType:bookTemp[4],
                        //注意点
                        noHot:bookTemp[6],
                        //项目类型
                        projectType:bookTemp[5],
                        //预留2
                        reserve1:bookTemp[7],
                        //预留3
                        reserve2:bookTemp[8],
                        //预留4
                        reserve3:bookTemp[9],
                      }
                      this.trendMarkersBook.push(temp)
                    }
                    alert("修改成功")
                    this.trendMarkersEditDialog=false
                  }
                })
              }
            }
          }
        }
      }
      //是向下插入
      else if (this.trendMarkersBookEditDoe===2){
        //校验数据
        if (this.trendMarkersEditForm.project===''){
          alert("请输入检测项目中文名称")
        }
        else if (this.trendMarkersEditForm.projectEnglish===''){
          alert("请输入检测项目英文名称")
        }
        else if (this.trendMarkersEditForm.projectRussian===''){
          alert("请输入检测项目俄文名称")
        }
        else if (this.trendMarkersEditForm.noHot===''){
          alert("请输入中文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotEnglish===''){
          alert("请输入英文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotRussian===''){
          alert("请输入俄文检测要点")
        }
        else if (this.trendMarkersEditForm.standardType===''){
          alert("请选择测量类型")
        }
        else if (this.trendMarkersEditForm.projectType===''){
          alert("请选择项目类型")
        }
        else if (this.trendMarkersEditForm.standard===''){
          alert("请写入标准值")
        }
        else if (this.trendMarkersEditForm.limit===''){
          alert("请输入上公差")
        }
        else if (this.trendMarkersEditForm.lower===''){
          alert("请输入下公差")
        }
        else {
          //校验是否有效数字
          let num = Number(this.trendMarkersEditForm.standard)
          //判断是不是一个有效的数据
          if (!(!isNaN(num) && isFinite(num))){
            alert("标准值输入的数字无效，请重新输入")
          }
          else {
            //校验是否有效数字
            let num1 = Number(this.trendMarkersEditForm.limit)
            //判断是不是一个有效的数据
            if (!(!isNaN(num1) && isFinite(num1))){
              alert("上公差输入的数字无效，请重新输入")
            }
            else {
              //校验是否有效数字
              let num2 = Number(this.trendMarkersEditForm.lower)
              //判断是不是一个有效的数据
              if (!(!isNaN(num2) && isFinite(num2))){
                alert("下公差输入的数字无效，请重新输入")
              }
              else {
                //组合数据
                let item =this.trendMarkersEditForm.project + '|*|' +
                    this.trendMarkersEditForm.projectEnglish + '|*|' +
                    this.trendMarkersEditForm.projectRussian + '|%|' +
                    this.trendMarkersEditForm.standard + '|%|' +
                    this.trendMarkersEditForm.limit + '|%|' +
                    this.trendMarkersEditForm.lower + '|%|' +
                    this.trendMarkersEditForm.standardType + '|%|' +
                    this.trendMarkersEditForm.projectType + '|%|' +
                    this.trendMarkersEditForm.noHot + '|*|' +
                    this.trendMarkersEditForm.noHotEnglish + '|*|' +
                    this.trendMarkersEditForm.noHotRussian + '|%|' +
                    this.trendMarkersEditForm.reserve1+'|%|'+
                    this.trendMarkersEditForm.reserve2+'|%|'+
                    this.trendMarkersEditForm.reserve3+'|%|'
                //把元数据分割
                let temp=this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers.split('|-|')
                //把新数据插入进来
                temp.splice(this.trendMarkersBookEditScope.$index+1,0,item)
                //组合成字符串数据
                let book=''
                for (let i = 0; i < temp.length-1; i++) {
                  book=book+temp[i]+'|-|'
                }
                //把组合的数据赋值给大表
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers=book
                //组合编辑人信息
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName=this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName+'/'+this.useName
                //向后端发送请求
                this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnology[this.equipmentTechnologyScope.$index]).then(result=>{
                  if (result.code === 401) {
                    this.$router.push('UserLogin')
                    alert("您未登录，请登录")
                  }else {
                    //更新大表数据
                    this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1, result.data)
                    //更新检测项目的表格
                    this.trendMarkersBook=[]
                    //把项目切割出来
                    const book=result.data.trendMarkers.split('|-|')
                    for (let i = 0; i < book.length-1; i++) {
                      //对每一个项目进行赋值
                      const bookTemp=book[i].split('|%|')
                      const temp={
                        //id
                        id:i,
                        //检测项目
                        project:bookTemp[0],
                        //标准值
                        standard:bookTemp[1],
                        //上公差
                        limit:bookTemp[2],
                        //下公差
                        lower:bookTemp[3],
                        //公差类型
                        standardType:bookTemp[4],
                        //注意点
                        noHot:bookTemp[6],
                        //项目类型
                        projectType:bookTemp[5],
                        //预留2
                        reserve1:bookTemp[7],
                        //预留3
                        reserve2:bookTemp[8],
                        //预留4
                        reserve3:bookTemp[9],
                      }
                      this.trendMarkersBook.push(temp)
                    }
                    alert("新增成功")
                    this.trendMarkersEditDialog=false
                  }
                })
              }
            }
          }

        }
      }
      //是删除本行
      else if (this.trendMarkersBookEditDoe===3){
        //把元数据分割
        let temp=this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers.split('|-|')
        //把新数据插入进来
        temp.splice(this.trendMarkersBookEditScope.$index,1)
        //组合成字符串数据
        let book=''
        for (let i = 0; i < temp.length-1; i++) {
          book=book+temp[i]+'|-|'
        }
        //把组合的数据赋值给大表
        this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers=book
        //组合编辑人信息
        this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName=this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName+'/'+this.useName
        //向后端发送请求
        this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnology[this.equipmentTechnologyScope.$index]).then(result=>{
          if (result.code === 401) {
            this.$router.push('UserLogin')
            alert("您未登录，请登录")
          }else {
            //更新大表数据
            this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1, result.data)
            //更新检测项目的表格
            this.trendMarkersBook=[]
            //把项目切割出来
            const book=result.data.trendMarkers.split('|-|')
            for (let i = 0; i < book.length-1; i++) {
              //对每一个项目进行赋值
              const bookTemp=book[i].split('|%|')
              const temp={
                //id
                id:i,
                //检测项目
                project:bookTemp[0],
                //标准值
                standard:bookTemp[1],
                //上公差
                limit:bookTemp[2],
                //下公差
                lower:bookTemp[3],
                //公差类型
                standardType:bookTemp[4],
                //注意点
                noHot:bookTemp[6],
                //项目类型
                projectType:bookTemp[5],
                //预留2
                reserve1:bookTemp[7],
                //预留3
                reserve2:bookTemp[8],
                //预留4
                reserve3:bookTemp[9],
              }
              this.trendMarkersBook.push(temp)
            }
            alert("新增成功")
            this.trendMarkersEditDialog=false
          }
        })
      }
      //是新建
      else if (this.trendMarkersBookEditDoe===4){
        //校验数据
        if (this.trendMarkersEditForm.project===''){
          alert("请输入检测项目中文名称")
        }
        else if (this.trendMarkersEditForm.projectEnglish===''){
          alert("请输入检测项目英文名称")
        }
        else if (this.trendMarkersEditForm.projectRussian===''){
          alert("请输入检测项目俄文名称")
        }
        else if (this.trendMarkersEditForm.noHot===''){
          alert("请输入中文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotEnglish===''){
          alert("请输入英文检测要点")
        }
        else if (this.trendMarkersEditForm.noHotRussian===''){
          alert("请输入俄文检测要点")
        }
        else if (this.trendMarkersEditForm.standardType===''){
          alert("请选择测量类型")
        }
        else if (this.trendMarkersEditForm.projectType===''){
          alert("请选择项目类型")
        }
        else if (this.trendMarkersEditForm.standard===''){
          alert("请写入标准值")
        }
        else if (this.trendMarkersEditForm.limit===''){
          alert("请输入上公差")
        }
        else if (this.trendMarkersEditForm.lower===''){
          alert("请输入下公差")
        }
        else {
          //校验是否有效数字
          let num = Number(this.trendMarkersEditForm.standard)
          //判断是不是一个有效的数据
          if (!(!isNaN(num) && isFinite(num))){
            alert("标准值输入的数字无效，请重新输入")
          }
          else {
            //校验是否有效数字
            let num1 = Number(this.trendMarkersEditForm.limit)
            //判断是不是一个有效的数据
            if (!(!isNaN(num1) && isFinite(num1))){
              alert("上公差输入的数字无效，请重新输入")
            }
            else {
              //校验是否有效数字
              let num2 = Number(this.trendMarkersEditForm.lower)
              //判断是不是一个有效的数据
              if (!(!isNaN(num2) && isFinite(num2))){
                alert("下公差输入的数字无效，请重新输入")
              }
              else {
                //组合数据
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].trendMarkers=this.trendMarkersEditForm.project + '|*|' +
                    this.trendMarkersEditForm.projectEnglish + '|*|' +
                    this.trendMarkersEditForm.projectRussian + '|%|' +
                    this.trendMarkersEditForm.standard + '|%|' +
                    this.trendMarkersEditForm.limit + '|%|' +
                    this.trendMarkersEditForm.lower + '|%|' +
                    this.trendMarkersEditForm.standardType + '|%|' +
                    this.trendMarkersEditForm.projectType + '|%|' +
                    this.trendMarkersEditForm.noHot + '|*|' +
                    this.trendMarkersEditForm.noHotEnglish + '|*|' +
                    this.trendMarkersEditForm.noHotRussian + '|%|' +
                    this.trendMarkersEditForm.reserve1+'|%|'+
                    this.trendMarkersEditForm.reserve2+'|%|'+
                    this.trendMarkersEditForm.reserve3+'|%|'+'|-|'

                //组合编辑人信息
                this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName=this.equipmentTechnology[this.equipmentTechnologyScope.$index].editName+'/'+this.useName
                //向后端发送请求
                this.$request.post('/equipmentTechnologyEdit',this.equipmentTechnology[this.equipmentTechnologyScope.$index]).then(result=>{
                  if (result.code === 401) {
                    this.$router.push('UserLogin')
                    alert("您未登录，请登录")
                  }else {
                    //更新大表数据
                    this.equipmentTechnology.splice(this.equipmentTechnology.$index, 1, result.data)
                    //更新检测项目的表格
                    this.trendMarkersBook=[]
                    //把项目切割出来
                    const book=result.data.trendMarkers.split('|-|')
                    for (let i = 0; i < book.length-1; i++) {
                      //对每一个项目进行赋值
                      const bookTemp=book[i].split('|%|')
                      const temp={
                        //id
                        id:i,
                        //检测项目
                        project:bookTemp[0],
                        //标准值
                        standard:bookTemp[1],
                        //上公差
                        limit:bookTemp[2],
                        //下公差
                        lower:bookTemp[3],
                        //公差类型
                        standardType:bookTemp[4],
                        //注意点
                        noHot:bookTemp[6],
                        //项目类型
                        projectType:bookTemp[5],
                        //预留2
                        reserve1:bookTemp[7],
                        //预留3
                        reserve2:bookTemp[8],
                        //预留4
                        reserve3:bookTemp[9],
                      }
                      this.trendMarkersBook.push(temp)
                    }
                    alert("新增成功")
                    this.trendMarkersEditDialog=false
                  }
                })
              }
            }
          }

        }
      }
    },
    //《工装台账》关联《工装技术条件》的弹框选择函数
    async clampAndTec() {
      //校核数据
      if (this.clampDataForm.department === '' || this.clampDataForm.department === undefined || this.clampDataForm.department === 'undefined') {
        alert('请选择部门')
        return
      }
      if (this.clampDataForm.position === '' || this.clampDataForm.position === undefined || this.clampDataForm.position === 'undefined') {
        alert('请选择存放地点')
        return
      }

      //组合数据
      let addTecDataTemp
      // 向后端查询数据，依据3个条件：1.所属部门是特定的，2.所属工序是特定的；就是用的工装技术条件查询的方法。
      if (this.asideButtonDoe === 1) {
        addTecDataTemp = await this.selectTechnologyData('装配车间/Assembly workshop/сборочный цех', this.clampDataForm.position, 1)
      } else if (this.asideButtonDoe === 2) {
        addTecDataTemp = await this.selectTechnologyData('机加车间/Machining workshop/Машиностроительный цех', this.clampDataForm.position, 2)
      } else if (this.asideButtonDoe === 3) {
        addTecDataTemp = this.selectTechnologyData('', this.clampDataForm.position, 3)
      }
      // 没有筛选的数据也传递出去，作为关联控制计划项的数据
      this.addTecDataAll=_.cloneDeep(addTecDataTemp)

      const seenClampNames = new Set();
      const uniqueByClampName = [];

      for (const item of addTecDataTemp) {
        if (!seenClampNames.has(item.clampName)) {
          seenClampNames.add(item.clampName);
          uniqueByClampName.push(item);
        }
      }

    // 现在 uniqueByClampName 包含了每个 clampName 不同的对象

      this.addTecData=[]
      this.addTecData=uniqueByClampName
      this.addTecDialog = true


    },
    //在弹出的关联技术条件的弹窗列表上单击
    addTeaTableClick(row){
      this.$confirm('确认选择本条吗？')
          // eslint-disable-next-line no-unused-vars
          .then(_ => {
            //进行赋值
            this.clampDataForm.clampName=row.clampName
            this.clampDataForm.modelId=row.modelId
            //组合控制计划关联号
            let temp=this.addTecDataAll.filter(item => item.drawingNo === row.drawingNo)
            console.log(row.drawingNo)
            console.log(this.addTecDataAll)
            console.log(temp)
            let str=''
            for (let i = 0; i < temp.length; i++) {
              str=str+'/'+temp[i].id
            }
            console.log(str)
            this.clampDataForm.controlPlan=str
            this.addTecDialog=false
          })
          // eslint-disable-next-line no-unused-vars
          .catch(_ => {});
    },
    //上传、插入工装检测数据控制弹窗
    equTestClick(doe,scope){
      //上传工装检测数据
      this.equTestListScope=scope
      this.equTestListDoe=doe
      this.equTestListFrom=_.cloneDeep(scope.row)
      this.equTestListFrom.testPer=this.useName
      this.titleUse='您正在上传检测数据'
      this.equTestDialog=true
    },
    // 在上传、插入工装检测数据的弹窗中点击确定按钮
    equTestEditClick(){
      //组合数据
      this.equTestListFrom.editMess=this.useName+'/'+this.nowDate()
      //向后端写入数据
      this.$request.post('/equTestInsertOne',this.equTestListFrom).then(result=>{
        if (result.code === 401) {
          this.$router.push('UserLogin')
          alert("您未登录，请登录")
        }else {
          //进行数据整合
          this.equTestListData[this.equTestListScope.$index].testDate=_.cloneDeep(this.equTestListFrom.testDate)
        }
      })

    }
  },
  mounted() {
    this.inquiry()
    //数据进行清零
    this.clampDataForm={}
    this.equipmentLedger=[]
    this.treeTableData=[]
    this.equipmentTechnologyForm={}
    this.equipmentTechnology=[]
    this.treePosition('department','position',1)
    this.trendMarkersBook=[]
  }
}
</script>

<style scoped>
/* 主体左侧的工作步骤栏用到的数据包围的div的样式*/

.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  border-left-color: white;
  border-top: white;
}

.el-aside {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
  height: 89vh;
}

.el-main {
  color: #333;
  text-align: center;
  border-width: 3px; /* 设置边框宽度为3像素 */
  border-color: blue; /* 设置边框颜色为蓝色 */
  border-left-color: white;
  border-style: solid; /* 设置边框样式为实线 */
  padding: 10px; /* 添加内边距 */
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.headMain{
  color: #ffffff; /* 设置字体颜色为红色 */
  font-size: 18px;
}
.center-text {
  /* 使用 margin-left 和 margin-right auto 来实现居中效果 */
  margin-left: auto;
  margin-right: auto;
  /* 注意：如果 header 内只有这两个元素，你可能不需要 margin-right: auto */
}

/*自定义样式*/
.el-table .warning-row {
  background: oldlace;
}
</style>